/***************************** BEGIN LICENSE BLOCK ***************************

 The contents of this file are subject to the Mozilla Public License Version
 1.1 (the "License"); you may not use this file except in compliance with
 the License. You may obtain a copy of the License at
 http://www.mozilla.org/MPL/MPL-1.1.html
 
 Software distributed under the License is distributed on an "AS IS" basis,
 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 for the specific language governing rights and limitations under the License.
 
 The Original Code is "SensorHub".
 
 The Initial Developer of the Original Code is Sensia Software LLC.
 <http://www.sensiasoftware.com>. Portions created by the Initial
 Developer are Copyright (C) 2013 the Initial Developer. All Rights Reserved.
 
 Please contact Alexandre Robin <alex.robin@sensiasoftware.com> for more 
 information.
 
 Contributor(s): 
    Alexandre Robin <alex.robin@sensiasoftware.com>
 
******************************* END LICENSE BLOCK ***************************/

package org.sensorhub.api.persistence;

import org.sensorhub.api.common.Event;


/**
 * <p>
 * Base class for events generated by storage modules
 * </p>
 *
 * <p>Copyright (c) 2010</p>
 * @author Alexandre Robin
 * @since Nov 12, 2010
 */
public class StorageEvent extends Event
{
    private static final long serialVersionUID = 4070048416493934591L;

    
    /**
     * Possible event types for a StorageEvent
     */
    public enum Type
    {
        INSERT,
        UPDATE,
        DELETE,
        RETRIEVE
    };
    
    
    /**
     * ID of storage that generated the event
     */
    protected String storageId;
    
    
    /**
     * Type of storage event
     */
    protected Type type;
    
    
    /**
     * ID of retrieved, added or updated records
     */
    protected long[] recordIds;


    public StorageEvent(String storageId, Type type)
    {
        this.type = type;
    }
    
    
    public String getStorageId()
    {
        return storageId;
    }


    public void setStorageId(String storageId)
    {
        this.storageId = storageId;
    }


    public Type getType()
    {
        return type;
    }


    public void setType(Type type)
    {
        this.type = type;
    }


    public long[] getRecordIds()
    {
        return recordIds;
    }


    public void setRecordIds(long[] recordIds)
    {
        this.recordIds = recordIds;
    }
}
